How Light Is Safe Recursion? Compositional Translations Between Languages of Polynomial Time
نویسندگان
چکیده
We investigate the relationship between two polynomial time languages: Bellantoni and Cook’s functional combinator language BC, and Girard’s Light Linear Logic LAL (as amended by Asperti). It is known that both languages characterize exactly the polynomial time functions. Despite this similarity, an open question has been to provide a compositional translation between the two languages: given a ptime function f described in a BC program pf , how can we translate pf into an LAL-program? Compositionality means that the translation of a program is a function of the translation of its constituent parts. The construction of such a compiler is fundamentally an exercise in functional programming. The best known such translation, due to Murawski and Ong, compiles only the linear fragment BC, where some variables can only be referenced once. We show that this fragment can be evaluated in logspace. Next, we prove that extensions of their approach to the full BC language cannot provide a correct translation into LAL. In fact, any translation that interprets integers and primitive recursion via inductive type codings fails. Finally, we provide a correct, compositional translation between the two languages. For this translation we generalize Turing machine simulations into an SECD machine, realized in LAL.
منابع مشابه
Weak Affine Light Typing: Polytime intensional expressivity, soundness and completeness
Ridefinite Quasi-linear come Composition-linear Weak affine light typing (WALT) assigns light affine linear formulae as types to a subset of λ-terms in System F. WALT is poly-time sound: if a λ-term M has type in WALT, M can be evaluated with a polynomial cost in the dimension of the derivation that gives it a type. In particular, the evaluation can proceed under any strategy of a rewriting rel...
متن کاملWeak Affine Light Typing is complete with respect to Safe Recursion on Notation
Weak affine light typing (WALT) assigns light affine linear formulae as types to a subset of λ-terms of 5 System F.WALT is poly-time sound: if a λ-termM has type inWALT,M can be evaluated with a polynomial cost in the dimension of the derivation that gives it a type. The evaluation proceeds under any strategy of a rewriting relation which is a mix of both call-by-name and call-by-value β-reduct...
متن کاملKent Implementation and Application of Functional Languages 19 th International Symposium , IFL 2007
Safe is a first-order eager functional language with facilities for programmer-controlled destruction and copying of data structures and is intended for compile-time analysis of memory consumption. In Safe, heap and stack memory consumption depends on the length of recursive calls chains. Ensuring termination of Safe programs (or of particular function calls) is therefore essential to implement...
متن کاملComputer Science at Kent Implementation and Application of Functional Languages 19 th International Symposium , IFL 2007
Safe is a first-order eager functional language with facilities for programmer-controlled destruction and copying of data structures and is intended for compile-time analysis of memory consumption. In Safe, heap and stack memory consumption depends on the length of recursive calls chains. Ensuring termination of Safe programs (or of particular function calls) is therefore essential to implement...
متن کاملLogic Column 9 Programming Languages Capturing Complexity Classes*
In recent years there has been a growing interest in programming languages with the property that all definable functions belong to some complexity class, often polynomial time or space. This research has established a link between computational complexity theory and the fields of type systems and programming language semantics with emerging applications to resource certification and programmin...
متن کامل